#ifndef _DXSOUND_H
#define _DXSOUND_H
#include <windows.h>
#include <dsound.h>
#include "..\common\arraylist.hpp"
#include "..\common\def.h"
#include "..\common\string.h"

namespace EESound {

class IResource;
class IAudio;
class EE_EXPORT CDSound9Device {
private:

	DSCAPS deviceCap; 
	LPDIRECTSOUND8 lpDirectSound; 

	ArrayList<IAudio*> m_SoundList; 
	HRESULT findResource(const string& indentity, IResource** pOut);

public:

	enum SoundType {
		WAV = 0,
		MP3 = 1,
		AUTO };

	HRESULT createSoundBuffer(LPDIRECTSOUNDBUFFER *pInOut, WAVEFORMATEX* pFormat, DWORD length); 
	HRESULT cloneSoundBuffer(LPDIRECTSOUNDBUFFER pIn, LPDIRECTSOUNDBUFFER *pOut); 
	HRESULT createSound(const string& szFilename, IAudio** pOut, SoundType type = AUTO); 

	CDSound9Device(); 

	virtual~CDSound9Device(void)
	{
	}

	void Update(void); 

	HRESULT			Release(void); 
	HRESULT			Initailize(void); 


}; 

}
#endif
